#include <iostream>
#include <iomanip>
#include <ios>

using namespace std;

int main()
{
	cout.setf(ios::right, ios::adjustfield);
	cout.width(50);
	cout << "This text is right justified" << endl;
	cout << "This text is left justified again" << endl;


	cout << right << setfill('.') << setw(30) << 500 << " pcs" << endl;
	cout << right << setfill('.') << setw(30) << 3000 << " pcs" << endl;
	cout << right << setfill('.') << setw(30) << 24500 << " pcs" << endl;

	cout.setf(ios::internal, ios::adjustfield);
	cout.width(30);
	cout << setfill('-') << "dir" << endl;
	cout << right << setfill('*') <<  setw(10) << "pcs" << endl;
	return 0;
}
